package com.kakaxi.mybilibili.module.home.find.model;

import com.alibaba.fastjson.JSONObject;
import com.kakaxi.mybilibili.common.WebUrlConst;
import com.kakaxi.mybilibili.net.FastJsonCacheRequest;
import com.kakaxi.mybilibili.net.Netroid;
import com.vincestyling.netroid.Listener;

/**
 * 发现中心数据层实现类
 * Created by kakaxi on 16/11/26.
 */

public class FindCenterModel implements IFindCenterModel {

    /** 话题 **/
    private static final int TYPE_TOPIC = 0;
    /** 活动 **/
    private static final int TYPE_EVENT = 1;

    @Override
    public void getCenterListData(int type, Listener<JSONObject> listener) {
        String url = null;
        switch (type) {
            case TYPE_TOPIC:
                url = WebUrlConst.FIND_CENTER_TOPIC_URL;
                break;
            case TYPE_EVENT:
                url = WebUrlConst.FIND_CENTER_EVENT_URL;
                break;
        }

        if (url != null) {
            Netroid.addRequest(new FastJsonCacheRequest(url, null, listener, null), true);
        }
    }
}
